<?php

/**
 * StaticPage form base class.
 *
 * @method StaticPage getObject() Returns the current form's model object
 *
 * @package    myarticles
 * @subpackage form
 * @author     Apul Gupta<apulmca2k4@gmail.com>
 */
abstract class BaseStaticPageForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'title'            => new sfWidgetFormInputText(),
      'url_slug'         => new sfWidgetFormInputText(),
      'meta_title'       => new sfWidgetFormInputText(),
      'meta_keyword'     => new sfWidgetFormInputText(),
      'meta_description' => new sfWidgetFormInputText(),
      'content'          => new sfWidgetFormTextarea(),
      'created_by'       => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => true)),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
      'is_active'        => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorPropelChoice(array('model' => 'StaticPage', 'column' => 'id', 'required' => false)),
      'title'            => new sfValidatorString(array('max_length' => 400)),
      'url_slug'         => new sfValidatorString(array('max_length' => 200)),
      'meta_title'       => new sfValidatorString(array('max_length' => 200)),
      'meta_keyword'     => new sfValidatorString(array('max_length' => 200)),
      'meta_description' => new sfValidatorString(array('max_length' => 300)),
      'content'          => new sfValidatorString(array('required' => false)),
      'created_by'       => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id', 'required' => false)),
      'created_at'       => new sfValidatorDateTime(array('required' => false)),
      'updated_at'       => new sfValidatorDateTime(array('required' => false)),
      'is_active'        => new sfValidatorBoolean(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('static_page[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'StaticPage';
  }


}
